package com.gandong8.derby.controller;

import cn.hutool.crypto.SecureUtil;
import org.jasypt.util.text.BasicTextEncryptor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TestController extends BaseController{

    @RequestMapping(value = "/test")
    @ResponseBody
    public String root() {
        return "ok";
    }


    public static void main(String[] args) {
        BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
        textEncryptor.setPassword(")(*fdweDEIK");
        String username = "root";
        String pwd = "123456";
        String usernameEnc = textEncryptor.encrypt(username);
        String passwordEnc = textEncryptor.encrypt(SecureUtil.sha1(pwd+"fwfsfds"));
        System.out.println("username:"+usernameEnc);
        System.out.println("password:"+passwordEnc);
    }
}
